/*
 Navicat Premium Data Transfer

 Source Server         : Local数据库
 Source Server Type    : MySQL
 Source Server Version : 80028
 Source Host           : 127.0.0.1:3306
 Source Schema         : belazy_base

 Target Server Type    : MySQL
 Target Server Version : 80028
 File Encoding         : 65001

 Date: 26/06/2022 15:45:06
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_login_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_login_log`;
CREATE TABLE `sys_login_log` (
  `id` varchar(64) NOT NULL,
  `source` varchar(255) DEFAULT NULL COMMENT '登录来源:App手机应用 Web应用',
  `user_name` varchar(255) DEFAULT NULL COMMENT '登录名称',
  `ipaddr` varchar(255) DEFAULT NULL COMMENT '登录IP',
  `browser` varchar(255) DEFAULT NULL COMMENT '设备版本(华为10)|浏览器(类型+版本)',
  `os` varchar(255) DEFAULT NULL COMMENT '操作系统',
  `version` varchar(255) DEFAULT NULL COMMENT 'APP版本，web不需要记录',
  `device_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '设备唯一标识（手机设备ID,电脑为MAC地址)',
  `status` int DEFAULT NULL COMMENT '登录状态（0成功 1失败）',
  `msg` varchar(255) DEFAULT NULL COMMENT '登录消息',
  `login_time` datetime DEFAULT NULL COMMENT '登录时间',
  `create_by` varchar(64) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_by` varchar(64) DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_login_log
-- ----------------------------
BEGIN;
INSERT INTO `sys_login_log` VALUES ('016a41e6-f510-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', '1', 'Mac OS X', 'v.12', '1', 1, '账号或密码错误,登录失败!', '2022-06-26 13:22:43', 'admin', '2022-06-26 13:22:43', 'admin', '2022-06-26 13:22:43');
INSERT INTO `sys_login_log` VALUES ('17169cbc-f50e-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Unknown', NULL, NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:09:00', 'admin', '2022-06-26 13:09:00', 'admin', '2022-06-26 13:09:00');
INSERT INTO `sys_login_log` VALUES ('1cf82b5e-f514-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:52:07', 'admin', '2022-06-26 13:52:07', 'admin', '2022-06-26 13:52:07');
INSERT INTO `sys_login_log` VALUES ('299ce510-f510-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:23:50', 'admin', '2022-06-26 13:23:50', 'admin', '2022-06-26 13:23:50');
INSERT INTO `sys_login_log` VALUES ('2d5a6c7c-f515-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:59:44', 'admin', '2022-06-26 13:59:44', 'admin', '2022-06-26 13:59:44');
INSERT INTO `sys_login_log` VALUES ('2faeedfe-f510-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:24:00', 'admin', '2022-06-26 13:24:00', 'admin', '2022-06-26 13:24:00');
INSERT INTO `sys_login_log` VALUES ('34de04a6-f50e-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Unknown', NULL, NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:09:50', 'admin', '2022-06-26 13:09:50', 'admin', '2022-06-26 13:09:50');
INSERT INTO `sys_login_log` VALUES ('44a1d6d4-f50d-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', '1', 'Mac OS X', '1', '1', 1, '账号或密码错误,登录失败!', '2022-06-26 13:03:07', 'admin', '2022-06-26 13:03:07', 'admin', '2022-06-26 13:03:07');
INSERT INTO `sys_login_log` VALUES ('4b38674e-f515-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 14:00:34', 'admin', '2022-06-26 14:00:34', 'admin', '2022-06-26 14:00:34');
INSERT INTO `sys_login_log` VALUES ('5f738996-f515-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 14:01:08', 'admin', '2022-06-26 14:01:08', 'admin', '2022-06-26 14:01:08');
INSERT INTO `sys_login_log` VALUES ('6648929e-f514-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:54:10', 'admin', '2022-06-26 13:54:10', 'admin', '2022-06-26 13:54:10');
INSERT INTO `sys_login_log` VALUES ('6b1bcd06-f50d-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Unknown', NULL, NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:04:12', 'admin', '2022-06-26 13:04:12', 'admin', '2022-06-26 13:04:12');
INSERT INTO `sys_login_log` VALUES ('6c1edd16-f453-11ec-825e-e36b6ddf18d8', NULL, 'admin', '127.0.0.1', NULL, 'Unknown', NULL, NULL, 1, '登录来源不属于系统!', '2022-06-25 14:52:47', 'admin', '2022-06-25 14:52:47', 'admin', '2022-06-25 14:52:47');
INSERT INTO `sys_login_log` VALUES ('791faeb2-f513-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:47:32', 'admin', '2022-06-26 13:47:32', 'admin', '2022-06-26 13:47:32');
INSERT INTO `sys_login_log` VALUES ('793e070a-f454-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Unknown', NULL, NULL, 0, '登录成功', '2022-06-25 15:00:19', 'admin', '2022-06-25 15:00:19', 'admin', '2022-06-25 15:00:19');
INSERT INTO `sys_login_log` VALUES ('8adb57ae-f50f-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', '1', 'Mac OS X', 'v.12', '1', 1, '账号或密码错误,登录失败!', '2022-06-26 13:19:24', 'admin', '2022-06-26 13:19:24', 'admin', '2022-06-26 13:19:24');
INSERT INTO `sys_login_log` VALUES ('a2b989fe-f514-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:55:51', 'admin', '2022-06-26 13:55:51', 'admin', '2022-06-26 13:55:51');
INSERT INTO `sys_login_log` VALUES ('cc7e7416-f50f-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', '1', 'Mac OS X', 'v.12', '1', 1, '账号或密码错误,登录失败!', '2022-06-26 13:21:14', 'admin', '2022-06-26 13:21:14', 'admin', '2022-06-26 13:21:14');
INSERT INTO `sys_login_log` VALUES ('d1bdced4-f50c-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', '1', 'Mac OS X', '1', '1', 1, '账号或密码错误,登录失败!', '2022-06-26 12:59:54', 'admin', '2022-06-26 12:59:54', 'admin', '2022-06-26 12:59:54');
INSERT INTO `sys_login_log` VALUES ('d83ebad0-f515-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 0, '登录成功', '2022-06-26 14:04:31', 'admin', '2022-06-26 14:04:31', 'admin', '2022-06-26 14:04:31');
INSERT INTO `sys_login_log` VALUES ('f49d1894-f514-11ec-825e-e36b6ddf18d8', 'web', 'admin', '127.0.0.1', NULL, 'Mac OS X', 'v.12', NULL, 1, '账号或密码错误,登录失败!', '2022-06-26 13:58:09', 'admin', '2022-06-26 13:58:09', 'admin', '2022-06-26 13:58:09');
COMMIT;

-- ----------------------------
-- Table structure for sys_oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `sys_oauth_client_details`;
CREATE TABLE `sys_oauth_client_details` (
  `client_id` varchar(256) NOT NULL COMMENT '用于唯一标识每一个客户端(client); 在注册时必须填写(也可由服务端自动生成)',
  `resources_ids` varchar(256) DEFAULT NULL COMMENT '客户端所能访问的资源id集合,多个资源时用逗号(,)分隔,如: "unity-resource,mobile-resource".',
  `client_secret` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用于指定客户端(client)的访问密匙; 在注册时必须填写(也可由服务端自动生成)对于不同的grant_type,该字段都是必须的',
  `scope` varchar(256) DEFAULT NULL COMMENT '指定客户端申请的权限范围,可选值包括read,write,trust;若有多个权限范围用逗号(,)分隔,如: "read,write".',
  `authorized_grant_types` varchar(256) DEFAULT NULL COMMENT '指定客户端支持的grant_type,若支持多个grant_type用逗号(,)',
  `web_server_redirect_uri` varchar(256) DEFAULT NULL,
  `authorities` varchar(256) DEFAULT NULL COMMENT '指定客户端所拥有的Spring Security的权限值,可选, 若有多个权限值,用逗号(,)分隔',
  `access_token_validity` int DEFAULT NULL COMMENT '设定客户端的access_token的有效时间值(单位:秒),可选, 若不设定值则使用默认的有效时间值(60 * 60 * 12, 12小时)',
  `refresh_token_validity` int DEFAULT NULL COMMENT '设定客户端的refresh_token的有效时间值(单位:秒),可选, 若不设定值则使用默认的有效时间值(60 * 60 * 24 * 30, 30天).',
  `addition_information` json DEFAULT NULL COMMENT '预留的字段,在Oauth的流程中没有实际的使用,可选,但若设置值,必须是JSON格式的数据',
  `autoapprove` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'false' COMMENT '设置用户是否自动Approval操作, 默认值为 "false", 可选值包括 "true,false, read,write",该字段只适用于grant_type="authorization_code"的情况',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='OAUTH2配置表';

-- ----------------------------
-- Records of sys_oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `sys_oauth_client_details` VALUES ('cloud', NULL, '$2a$10$X1HOPGX6ADkQn4rvtk.C4uaz8vF1TdpY2aP/iC.3UKlonvco/k9e.', 'server', 'password,refresh_token,authorization_code,sms_code', NULL, NULL, 18000, NULL, NULL, 'false', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `account` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户账号',
  `nick_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户昵称',
  `user_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '00' COMMENT '用户类型（00系统用户）',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '用户邮箱',
  `mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '手机号码',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '密码',
  `register_way` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '1' COMMENT '0系统内置 1系统添加 2用户注册',
  `is_account_enabled` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '帐号是否启用（0正常 1停用）',
  `is_account_expired` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '账号是否过期（0正常 1停用）',
  `is_account_locked` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '账号是否锁定（0正常 1停用）',
  `is_credentials_expired` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '证书是否过期（0正常 1停用）',
  `is_delete` int DEFAULT '0' COMMENT '0 正常 1删除',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `update_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户信息表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1', 'admin', '超级管理员', '00', '', '15721539459', '$2a$10$KRyIYftzxvta1DR65s/DwehIz3MXMHqbvJQPjAQvjr43P1cRtNJHW', '1', '0', '0', '0', '0', 0, NULL, '', NULL, '', NULL, NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
